Skip to content

docs: add CLAUDE.md documenting the machine-spec drift gate (#1666) - #49

Merged
MichaelTaylor3d merged 1 commit into
mainfrom
docs/1666-document-drift-gate
Jul 27, 2026
Merged

docs: add CLAUDE.md documenting the machine-spec drift gate (#1666)#49
MichaelTaylor3d merged 1 commit into
mainfrom
docs/1666-document-drift-gate

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

Closes dig_ecosystem#1666.

docs.dig.net had no repo-root CLAUDE.md, so the machine-spec drift gate — the one load-bearing gotcha here — was documented nowhere a contributor/agent looks first. The first symptom of tripping it is an unexplained npm run build failure on what looked like a one-line docs edit.

What this adds

A concise CLAUDE.md documenting the drift gate, verified against source (not just restated from the ticket):

  • scripts/dig-spec.mjs (source of truth), docs/support/error-codes.md + docs/rpc/*.md (prose), and static/*.json (generated) move together.
  • scripts/gen-machine-specs.mjs driftGate() parses the prose tables and assertSetEquals them against the catalog, throwing error-codes drift for <surface> … on divergence (line 151), before the JSON is written.
  • npm run gen runs that check and is wired into prebuild/prestart, so editing error-codes.md alone fails the build; the fix is to mirror the change in dig-spec.mjs and npm run gen in the same commit — never to weaken the gate.

Also points at the superproject frontend-baseline skill, where the general pattern (any canonical-source + prose-mirror surface carries a documented regen ceremony) is being recorded.

Verification

Drift-check confirmed load-bearing by reading gen-machine-specs.mjs (driftGateassertSetEqual throws; runs at module top-level before writeFileSync). Docs-only change + version bump 0.7.0 → 0.7.1 (patch).


Generated by Claude Code

Record the error-codes / RPC machine-spec drift gate where a contributor
looks first: scripts/dig-spec.mjs (source of truth), docs/support/error-codes.md
(prose), and the static/*.json generated artifacts move together, and
`npm run gen` (wired into prebuild/prestart) drift-checks the prose against the
source — so editing error-codes.md alone fails the build. Points at the
frontend-baseline skill for the general pattern.

Closes dig_ecosystem#1666
Co-Authored-By: Claude <noreply@anthropic.com>
@MichaelTaylor3d
MichaelTaylor3d merged commit de3b8a3 into main Jul 27, 2026
7 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the docs/1666-document-drift-gate branch July 27, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant